home *** CD-ROM | disk | FTP | other *** search
- function loadImage(mc, node, extrapath)
- {
- var _loc3_ = extrapath;
- if(_loc3_ == null)
- {
- _loc3_ = "";
- }
- var strDefaultPath = Tardis.ASSETS_FOLDER + "images/" + Tardis.ActiveSection.id + "/";
- var _loc1_ = node.firstChild.nodeValue;
- var _loc2_ = node.attributes.path;
- if(_loc2_ != null)
- {
- _loc1_ = _loc2_ + _loc1_;
- }
- else
- {
- _loc1_ = strDefaultPath + _loc3_ + _loc1_;
- }
- if(strPathPrefix == null)
- {
- strPathPrefix = "";
- }
- mc.loadMovie(strPathPrefix + _loc1_);
- }
- function addLink(mc)
- {
- Links[mc.link] = mc;
- }
- function getMCfromLink(Item)
- {
- var _loc1_ = Item;
- if(Links[_loc1_] == null)
- {
- var _loc2_ = [];
- while(_loc1_ != sideMenu.ItemHome)
- {
- _loc2_.unshift(_loc1_._name.split("_").pop());
- _loc1_ = _loc1_._parent._parent;
- }
- var _loc3_ = _loc2_.join("/");
- Links[_loc1_] = Links[_loc3_];
- }
- return Links[_loc1_];
- }
- function removeLinkListener()
- {
- Tardis.sideMenu.EB.removeListener(this);
- }
- function interrupt()
- {
- fade(this.snd,0);
- }
- function resume()
- {
- trackUp(mc_t_1);
- }
- function init()
- {
- build();
- }
- function build()
- {
- TEXT_POS = 5;
- var _loc3_ = Tardis.ActiveSection.id;
- var _loc1_ = Tardis.Colors;
- strSECTION_COLOR = _loc1_.getString(_loc3_);
- SECTION_COLOR = _loc1_.getHex(_loc3_);
- SECTION_COLOR50 = _loc1_.getString(_loc3_ + "50");
- DEFAULT_COLOR = _loc1_.getHex("default");
- DEFAULT_COLOR50 = _loc1_.getString("default50");
- IMAGE_PATH = nodeData.attributes.imagepath;
- ndTracks = nodeData.byName("track");
- strTrackpath = Tardis.ASSETS_FOLDER + ndTracks.attributes.path;
- if(nodeData.byName("title") != null || nodeData.byName("title2") != null || nodeData.byName("title3") != null)
- {
- var _loc2_ = "<FONT COLOR=\"" + strSECTION_COLOR + "\">" + nodeData.byName("title").getText() + " </FONT>";
- _loc2_ += "<FONT COLOR=\"" + SECTION_COLOR50 + "\">" + nodeData.byName("title2").getText() + "</FONT>";
- _loc2_ += "<FONT COLOR=\"" + SECTION_COLOR50 + "\">" + nodeData.byName("title3").getText() + "</FONT>";
- titleFF.htmlText = _loc2_;
- titleFF.resize();
- titleFF._y = TEXT_POS;
- TEXT_POS += titleFF._height - 4;
- }
- if(nodeData.byName("byline") != null)
- {
- title2FF.htmlText = nodeData.byName("byline").getText();
- title2FF.resize();
- title2FF.textColor = DEFAULT_COLOR;
- title2FF._y = TEXT_POS;
- TEXT_POS += title2FF._height - 9;
- }
- if(nodeData.byName("body") != null)
- {
- bodyFF.htmlText = parseBoldTags(nodeData.byName("body").getText());
- bodyFF.textColor = DEFAULT_COLOR;
- bodyFF.resize();
- bodyFF._y = TEXT_POS;
- TEXT_POS += bodyFF._height;
- }
- if(nodeData.byName("image") != null)
- {
- loadImage(mc_images,nodeData.byName("image"),IMAGE_PATH);
- }
- trackLabelFF.htmlText = ndTracks.byName("label").getText();
- trackLabelFF.resize();
- trackLabelFF.textColor = DEFAULT_COLOR;
- trackLabelFF._y = 385 - trackLabelFF._height + 5;
- mc_timebar._y = trackLabelFF._y - 5;
- mc_controls._y = mc_timebar._y - 17;
- _visible = true;
- playSound();
- onComplete();
- }
- function parseBoldTags(str)
- {
- var _loc1_ = str;
- var _loc2_ = _loc1_.indexOf("<b>");
- if(_loc2_ != -1)
- {
- var _loc3_ = _loc1_.indexOf("</b>");
- var word = _loc1_.substring(_loc2_ + 3,_loc3_);
- var beginning = _loc1_.substring(0,_loc2_);
- var end = _loc1_.substring(_loc3_ + 4);
- return beginning + "<font face=\'FranklinGotURWTDem\'>" + word + "</font>" + parseBoldTags(end);
- }
- return _loc1_;
- }
- function playSound()
- {
- createEmptyMovieClip("mc_sound",Tardis.depth++);
- snd = new Sound(mc_sound);
- var _loc1_ = strPathPrefix + strTrackpath + ndTracks.byName("file").firstChild.nodeValue;
- snd.loadSound(_loc1_,false);
- snd.onLoad = function()
- {
- this.start();
- mc_timebar.play();
- mc_controls.gotoAndStop("active");
- };
- }
- function resumeSound(posToStart)
- {
- var _loc1_ = posToStart;
- if(_loc1_ == null)
- {
- sndPos = snd.position / 1000;
- }
- else
- {
- sndPos = _loc1_;
- }
- if(_loc1_ == 0)
- {
- trackUp(currentTrack);
- }
- else
- {
- snd.start(sndPos,1);
- }
- }
- function pauseSound()
- {
- snd.stop();
- }
- function stopSound()
- {
- snd.stop();
- delete snd;
- mc_sound.removeMovieClip();
- }
- function startTimebar()
- {
- var _loc1_ = this;
- mc_timebar.onEnterFrame = function()
- {
- var _loc1_ = this;
- if(_loc1_.DRAGGING == true)
- {
- var _loc2_ = _loc1_.mc_handle._x / _loc1_.AVAIL_WIDTH;
- var f = Math.round(_loc2_ * _loc1_._parent.snd.duration);
- }
- else if(_loc1_._parent.mc_controls._currentFrame == 20)
- {
- _loc2_ = _loc1_._parent.snd.position / _loc1_._parent.snd.duration;
- if(_loc2_ < 1)
- {
- _loc1_.mc_handle._x = _loc2_ * _loc1_.AVAIL_WIDTH;
- }
- }
- };
- }
- function clearUp()
- {
- mc_timebar.onEnterFrame = null;
- }
- function setWidth(nm)
- {
- mc_timebar.mc_track._width = nm;
- mc_timebar.AVAIL_WIDTH = nm - mc_timebar.mc_handle._width;
- }
- function setTarget(mc)
- {
- mc_timebar.TARGET = snd;
- }
- Links = {};
- Tardis.sideMenu.EB.addListener(this);
- _visible = false;
- onReady();
- this.onUnload = function()
- {
- interrupt();
- removeLinkListener();
- this.onUnload = null;
- };
- mc_timebar.mc_handle.btn.onPress = function()
- {
- var _loc1_ = this;
- _loc1_._parent.startDrag(false,0,0,_loc1_._parent._parent.AVAIL_WIDTH,0);
- _loc1_._parent._parent.DRAGGING = true;
- _loc1_._parent._parent._parent.soundPause();
- };
- mc_timebar.mc_handle.btn.onRelease = mc_timebar.mc_handle.btn.onReleaseOutside = function()
- {
- var _loc1_ = this;
- _loc1_.posToStart = math.ceil(_loc1_._parent._parent.mc_handle._x / _loc1_._parent._parent.AVAIL_WIDTH * _loc1_._parent._parent.TARGET.duration / 1000);
- if(_loc1_._parent._parent.mc_controls._currentFrame != 30)
- {
- _loc1_._parent._parent._parent.soundResume(_loc1_.posToStart);
- }
- _loc1_._parent.stopDrag();
- _loc1_._parent._parent.DRAGGING = false;
- };
- mc_timebar.mc_handle.btn.onRollOver = function()
- {
- var _loc1_ = this;
- _loc1_.myColor = new Color(_loc1_._parent.scrubbaMC);
- _loc1_.myColor.setRGB(_loc1_._parent._parent._parent.SECTION_COLOR);
- };
- mc_timebar.mc_handle.btn.onRollOut = function()
- {
- var _loc1_ = this;
- _loc1_.myColor = new Color(_loc1_._parent.scrubbaMC);
- _loc1_.myColor.setRGB(_loc1_._parent._parent._parent.DEFAULT_COLOR);
- };
-